package com.chao.yyks.modular.label.controller;

import com.alibaba.fastjson.JSONObject;
import com.chao.common.util.log.Inter;
import com.chao.common.util.reaction.PageList;
import com.chao.yyks.modular.label.bean.EnLabel;
import com.chao.yyks.modular.label.service.EnLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * 板块Controller
 * chao
 * 2024-09-12
 */
@RestController
@RequestMapping("/enLabel")
public class EnLabelController {

	/**
	 * 板块Service
	 */
	@Autowired
	private EnLabelService enLabelService;

	/**
	 * 新增板块
	 */
	@Inter("ELL_ADD_01")
	@RequestMapping(method = RequestMethod.POST, value = "insertEnLabel")
	public void insertEnLabel(@RequestBody EnLabel enLabel){
		enLabelService.insertEnLabel(enLabel);
	}

	/**
	 * 修改板块
	 */
	@Inter("ELL_EDT_01")
	@RequestMapping(method = RequestMethod.POST, value = "updateEnLabel")
	public void updateEnLabel(@RequestBody EnLabel enLabel){
		enLabelService.updateEnLabel(enLabel);
	}

	/**
	 * 查询板块详情
	 */
	@Inter("ELL_SEL_01")
	@RequestMapping(method = RequestMethod.GET, value = "selectEnLabelByLabelId")
	public EnLabel selectEnLabelByLabelId(String labelId){
		return enLabelService.selectEnLabelByLabelId(labelId);
	}

	/**
	 * 查询板块列表
	 */
	@Inter("ELL_SEL_02")
	@RequestMapping(method = RequestMethod.GET, value = "selectEnLabelByList")
	public PageList<EnLabel> selectEnLabelByList(@RequestParam Map<String,Object> map){
		return enLabelService.selectEnLabelByList(new JSONObject(map));
	}

}